package com.yuantu.judiciary.common;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 基础错误码
 *
 * @author syw
 * @since 2023-06-07
 **/
@Getter
@AllArgsConstructor
public enum SysCode implements CodeEnum {

    /**
     * 系统码
     */
    SUCCESS(0, "ok"),
    SYSTEM_ERROR(50000, "系统内部异常"),
    EXTERNAL_API_ERROR(50001, "外部接口调用异常"),
    EXTERNAL_API_ENCODE_OR_DECODE_ERROR(50002, "外部接口加/解密异常"),
    FILE_SIZE_TOO_BIG(50003, "文件超出限制"),
    FILE_UPLOAD_FAIL(50004, "文件上传失败"),
    FILE_DOWNLOAD_FAIL(50005, "文件下载失败"),
    FILE_NAME_EMPTY(50006, "文件名称不能为空"),
    FILE_EMPTY(50007, "上传文件不能为空"),
    TOKEN_INVALID(50008, "令牌失效"),
    TOKEN_EXPIRED(50009, "令牌过期"),
    ACCESS_TOKEN_EXPIRED(50010, "访问令牌过期"),
    REFRESH_TOKEN_EXPIRED(50011, "刷新令牌过期"),
    UN_AUTHENTICATION(50012, "认证失败"),
    UN_AUTHORIZATION(50013, "授权失败"),
    WX_APPLET_API_ERROR(50014, "微信小程序接口调用异常"),
    WX_APPLET_API_TOKEN_ERROR(50015, "微信小程序接口获取凭据调用异常"),
    WX_APPLET_API_PHONE_ERROR(50016, "微信小程序接口获取手机号调用异常"),
    WX_APPLET_API_OPENID_ERROR(50017, "微信小程序接口获取 openid 调用异常"),
    FILE_EXPORT_ERROR(50018, "文件导出失败"),
    ALI_APPLET_API_PHONE_ERROR(50019, "支付宝小程序获取手机号异常"),
    ALI_APPLET_API_USER_INFO_ERROR(50019, "支付宝小程序获取用户信息异常"),
    ALI_APPLET_API_IDENTIFICATION_INIT_ERROR(50020, "支付宝小程序身份认证初始化异常"),
    ALI_APPLET_API_IDENTIFICATION_CERTIFY_ERROR(50021, "支付宝小程序开始身份认证异常"),
    ALI_APPLET_API_IDENTIFICATION_QUERY_ERROR(50022, "支付宝小程序查询认证结果异常"),
    ALI_APPLET_API_GET_USERID_ERROR(50023, "支付宝小程序获取用户授权信息异常"),
    ALI_APPLET_API_ADD_ORDER_ERROR(50024, "支付宝小程序添加订单异常"),
    OPEN_API_DECODE_ERROR(50025, "开放接口参数有误"),
    INVALID_TOKEN(50026, "无效令牌"),
    IP_INVALID(50027, "IP地址不在国内, 无法访问资源"),
    FILE_FORMAT_ERROR(50028, "上传文件格式错误"),
    FILE_CONTENT_VALID_ERROR(50029, "文件内容验证错误"),

    ;

    private final int code;
    private final String message;
}
